package top.chukongxiang.monitorservice.model.dto;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 楚孔响
 * @version 1.0
 * @date 2023/11/15 09:36
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class UserInfoSearchCond extends FingerPrintInfo {

    private List<EmployeeNo> EmployeeNoList;

    public UserInfoSearchCond addEmployeeNo(String employeeNo) {
        if (this.EmployeeNoList == null) {
            this.EmployeeNoList = new ArrayList<>();
        }
        EmployeeNo employeeNoDto = new EmployeeNo();
        employeeNoDto.setEmployeeNo(employeeNo);
        this.EmployeeNoList.add(employeeNoDto);
        return this;
    }

    public JSONObject toSdkJson() {
        JSONObject userInfoSearchCond = JSONUtil.parseObj(this, true);
        JSONObject result = new JSONObject();
        result.set("UserInfoSearchCond", userInfoSearchCond);
        return result;
    }

    @Data
    public static class EmployeeNo {
        private String employeeNo;
    }

}
